﻿@model tutors_clus.ViewModel.Home_ViewModel
@{ViewBag.Title = "Trang chủ";}
<article class="content">
    
    <section>
        
        <ul data-role="listview" data-ajax="false" data-inset="true" data-theme="d">
            <li data-role="list-divider">@Html.ActionLink("Lớp học mới", "Coures")</li>
            @foreach (var item in Model.courses)
            { 
                <li>
                    @Html.ActionLink(@item.name_cou+" - "+item.createdate_cou, "Detail_Coures", new { id = item.id_cou})
                 </li>
            }
            <li>@Html.ActionLink("Xem tất cả lớp đang mở", "Coures")
       </li>
        </ul>
        
    </section>
    <section>
        
        <ul data-role="listview" data-ajax="false" data-inset="true" data-theme="d">
            <li data-role="list-divider">@Html.ActionLink("Thông báo", "annoucements")</li>
            @foreach (var item in Model.annoucements)
               {
                <li><a href="@Url.Action("annoucements","Home",new { id = @item.id_ann})">
                    <h2>@item.title_ann</h2>
                    <p>@MvcHtmlString.Create(item.detail_ann)</p>
                    <p class="ui-li-aside">@Html.DisplayFor(m => item.create_date_ann).ToString().Substring(0,10)</p>
                </a></li>
                @*<li>
                   <div class="news">
                       <div class="title_news">@Html.ActionLink(@item.title_new, "Detail_News", new { id = item.id_new}) <i>(@Html.DisplayFor(m => item.create_date_new).ToString().Substring(0,10))</i></div>
                       <div class="detail_news"> @MvcHtmlString.Create(item.detail_new.Substring(0,200))...</div>
                       <div class="readmore">@Html.ActionLink("xem tiếp", "Detail_News", new { id = item.id_new})</div>                      
                       <div class="line"></div>
                   </div>
                  </li> *@
               } 
        </ul>
    </section>
    <section>
        
        <ul data-role="listview" data-ajax="false" data-inset="true" data-theme="d">
            <li data-role="list-divider">@Html.ActionLink("Tin tức", "News", "Home", new { @data_role="list-divider"})</li>
            @foreach (var item in Model.news)
               {
                <li>
                    <a href="@Url.Action("Detail_News","Home",new { id = item.id_new})">
                        @if (item.image_news == "" || item.image_news == null)                                                 
	                    {
                              <img src="../Content/images/noimage.gif"/>                                  
		                    
	                    }
                        else
                        {
                             <img src="@item.image_news"/>   
                             
                        }
                        <h2>@item.title_new</h2>
                        <p>@MvcHtmlString.Create(item.detail_new.Substring(0,200))...</p>
                    </a>
                </li>
                 
               }
        </ul>
    </section>
</article>



